package com.jianwei.configuration;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 改造雪花算法ID生成器
 * @author wjwei
 */
@ConfigurationProperties(prefix = "id-generator.snowflake")
public class SnowflakeConfiguration {

    private Boolean enable;

    private Integer workers;

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public Integer getWorkers() {
        return null == workers ? 1 : workers;
    }

    public void setWorkers(Integer workers) {
        this.workers = workers;
    }
}
